from random import randint
class Die:
    def __init__(self, sides=6):
        """骰子默认为6面"""
        self.sides = sides
    def roll_die(self):
        """返回骰子位于1和面数之间的随机数"""
        return randint(1, self.sides)